<?php

namespace app\admin\model\personal;

use think\Model;


class AccountLog extends Model
{

    

    

    // 表名
    protected $name = 'account_log';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [

    ];


    /**
     * 添加日志明细
     */
    public function addAccountLog($uid, $money, $type, $content, $status, $arrivaltime,$form=1)
    {
        $data = [
            'uid'       => $uid,
            'log_sn'    => date('YmdHis') . rand(10000000,99999999),
            'money'     => $money,
            'type'      => $type,
            'content'   => $content,
            'status'    => $status,
            'createtime'=> time(),
            'arrivaltime'=> $arrivaltime?:time(),
            'form'       => $form,
        ];
        $result = self::allowField(true)->save($data);
        return $result;
    }
    

    







}
